//
//  PassedRankModel.m
//  CapriceMusic
//
//  Created by 蒋恩浩 on 16/1/13.
//  Copyright © 2016年 MYX. All rights reserved.
//

#import "PassedRankModel.h"

@implementation PassedRankModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    if ([key isEqualToString:@"years"]) {
        
        self.yearsDataSource = [NSArray arrayWithArray:value];
    }
    if ([key isEqualToString:@"periods"]) {
        
        NSArray *array = value;
        NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dictionary in array) {
            
            PassedDetailModel *detailModel = [[PassedDetailModel alloc] initWithDictionary:dictionary];
            [mutableArray addObject:detailModel];
        }
        self.periodsDataSource = [NSArray arrayWithArray:mutableArray];
    }
}

@end
